import request from "@/utils/request";

// 知识库知识内容-查询列表
export function getknowledgeList(data) {
  return request({
    url: `/manager/knowledge/list`,
    method: "get",
    params: data,
  });
}
// 知识库知识草稿-复制
export function copyknowledge(temporaryId) {
  return request({
    url: `/manager/knowledge/temporary/copy/${temporaryId}`,
    method: "post",
  });
}
// 知识库知识内容-生成二维码

export function generateQRCode(categoryId) {
  return request({
    url: `/manager/knowledge/category/generateQRCode/${categoryId}`,
    method: "put",
  });
}
// 知识库知识内容-修改
export function putknowledge(data) {
  return request({
    url: `/manager/knowledge`,
    method: "put",
    data: data,
  });
}
// 知识库知识内容-删除
export function deleteknowledge(id) {
  return request({
    url: `/manager/knowledge/${id}`,
    method: "delete",
  });
}

// 知识库知识内容-获取详细信息
export function getknowledge(id) {
  return request({
    url: `/manager/knowledge/${id}`,
    method: "get",
  });
}

// -----------------------------------------------
// 知识库知识内容草稿-查询列表
export function getknowledgeTemporaryList(data) {
  return request({
    url: `/manager/knowledge/temporary/list`,
    method: "get",
    params: data,
  });
}
// 知识库知识内容草稿-获取详细信息

export function getknowledgetemporary(knowledgeId) {
  return request({
    url: `/manager/knowledge/temporary/${knowledgeId}`,
    method: "get",
  });
}
// 知识库类目草稿-新增
export function postknowledgetemporary(data) {
  return request({
    url: `/manager/knowledge/temporary`,
    method: "post",
    data: data,
  });
}
// 知识库知识草稿-修改
export function putknowledgetemporary(data) {
  return request({
    url: `/manager/knowledge/temporary`,
    method: "put",
    data: data,
  });
}
// 知识库知识草稿-删除
export function deleteknowledgetemporary(temporaryId) {
  return request({
    url: `/manager/knowledge/temporary/${temporaryId}`,
    method: "delete",
  });
}
// 知识库知识草稿-提交和撤销
export function submitknowledgetemporary(temporaryId, state) {
  return request({
    url: `/manager/knowledge/temporary/submit/${temporaryId}/${state}`,
    method: "put",
  });
}
// 知识草稿-审核前置校验

export function beforeCheck(id) {
  return request({
    url: `/manager/knowledge/temporary/approval/beforeCheck`,
    method: "get",
    params: { knowledgeTemporaryId: id },
  });
}
// 知识库知识草稿-审核
export function approvalknowledgetemporary(temporaryId, state, data) {
  return request({
    url: `/manager/knowledge/temporary/approval/${temporaryId}/${state}`,
    method: "put",
    data: data,
  });
}

// 知识库知识草稿-同步至正式知识
export function synchronizeknowledgetemporary(id) {
  return request({
    url: `/manager/knowledge/temporary/synchronize/${id}`,
    method: "put",
  });
}
